/**
* UserEdit.php
*
* This page is for users to edit their account information
* such as their password, email address, etc. Their
* usernames can not be edited. When changing their
* password, they must first confirm their current password.
*
* Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
* Last Updated: August 26, 2004
*/
include ('header.php');
?>
Link Centre Listings
/**
* User has submitted form without errors and user's
* account has been edited successfully.
*/
if(isset($_SESSION['useredit'])){
unset($_SESSION['useredit']);
echo "User Account Edit Success!
";
echo "$session->username, your account has been successfully updated. "
."Main.
";
}
else{
?>
/**
* If user is not logged in, then do not display anything.
* If user is logged in, then display the form to edit
* account information, with the current email address
* already in the field.
*/
if($session->logged_in){
// echo "Logged In
";
// echo "Welcome $session->username, you are logged in.
";
// Include centralized database configuration if not already available from header.php
if (!isset($db)) {
require_once __DIR__ . '/../../../../config/database.php';
try {
// Use centralized secure helper
$db = getSecureDatabaseConnection();
} catch (Exception $e) {
abortDatabaseConnection("Database connection error. Please try again later.", $e);
}
}
try {
$stmt = $db->prepare("SELECT * FROM users LEFT JOIN links ON users.email = links.email WHERE users.username = ?");
$stmt->execute([$session->username]);
} catch (Exception $e) {
error_log("Database error in listings.php: " . $e->getMessage());
die("Database query failed");
}
echo "";
echo "[
My Account] "
."[
Edit Account]
[
Listings] ";
if($session->isAdmin()){
echo "[
Admin Center] ";
}
echo "[
Logout]";
echo "
Here are your listings at Link Centre
You can use this page to view, update and upgrade the listings for your web sites.
| Country | Web Address | Title | Description |
";
while( $row = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($row['rank'] > '999999') {$rank = "5"; }
elseif ($row['rank'] > '499999') {$rank = "4"; }
elseif ($row['rank'] > '99999') {$rank = "3"; }
elseif ($row['rank'] > '9999') {$rank = "2"; }
elseif ($row['rank'] > '999') {$rank = "1"; }
elseif ($row['rank'] < '1000') {$rank = "0"; }
if ($row['paid'] > '34') { $freeorpremium = "premium"; } else { $freeorpremium = "trans"; }
echo "
 |
" . $row['url'] . " |
" . $row['title'] . " |
" . $row['description'] . " |
" . $row['excludesearch'] . " |
 |
" . $row['category'] . " |
" . $row['page_status'] . " |
" . $row['email'] . " |
" . $row['rank'] . " - " . $rank . " |
|
";
}
echo "
";
}
}
?>